<?php //echo "<pre>"; print_r($pBarang);die();?>
<?php $this -> load -> view('header'); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container row-fluid">
	<?php $this->load->view('sidebar');?>
	<!-- BEGIN PAGE -->
	<div class="page-content">
		<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<div id="portlet-config" class="modal hide">
			<div class="modal-header">
				<button data-dismiss="modal" class="close" type="button"></button>
				<h3>portlet Settings</h3>
			</div>
			<div class="modal-body">
				<p>
					Here will be a configuration form
				</p>
			</div>
		</div>
		<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<!-- BEGIN PAGE CONTAINER-->
		<div class="container-fluid">
			<!-- BEGIN PAGE HEADER-->
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN STYLE CUSTOMIZER -->
					<div class="color-panel hidden-phone">
						<div class="color-mode-icons icon-color"></div>
						<div class="color-mode-icons icon-color-close"></div>
						<div class="color-mode">
							<p>
								THEME COLOR
							</p>
							<ul class="inline">
								<li class="color-black current color-default" data-style="default"></li>
								<li class="color-blue" data-style="blue"></li>
								<li class="color-brown" data-style="brown"></li>
								<li class="color-purple" data-style="purple"></li>
								<li class="color-white color-light" data-style="light"></li>
							</ul>
							<label class="hidden-phone">
								<input type="checkbox" class="header" checked value="" />
								<span class="color-mode-label">Fixed Header</span> </label>
						</div>
					</div>
					<!-- END BEGIN STYLE CUSTOMIZER -->

					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title"> Katalog <small>Barang</small></h3>
					<?php $this -> load -> view('breadcrumb'); ?>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box blue">
						<div class="portlet-title">
							<h4><i class="icon-edit"></i>Barang</h4>
							<!--<div class="tools" >
								<a href="javascript:;" class="reload"></a>
							</div>-->
														
							<div class="actions" style="padding-right: 0px">
								<a href="<?php echo base_url()?>katalog/createEdit" class="btn green"><i class="icon-plus"></i> Add</a>								
								<a href="#" class="btn green"><i class="icon-print"></i> Print</a>
								<a href="#" class="btn green"><i class="icon-tasks"></i> Pdf</a>
								<a href="#" class="btn green"><i class="icon-envelope"></i> Excel</a>								
							</div>
							
						</div>
						<div class="portlet-body">
							<?php $this->load->view('searchBar', $searchBar);?>
							<table class="table table-striped table-hover table-bordered" >
								<thead>
									<tr>
										<th>Nama Barang</th>
										<th>Category</th>
										<th>Jumlah/Satuan</th>
										<th>Harga Beli</th>
										<th>Tanggal Stock</th>
										<th>Edit</th>
										<th>Delete</th>
									</tr>
								</thead>
								<tbody>
								<?php foreach ($pBarang['data'] as $barang){ ?>
									<tr class="">
										<td><?php echo $barang->getName();?></td>
										<td><?php echo $barang->getCategory() !== null ? $barang->getCategory()->getName() : "";?></td>
										<td><?php echo $barang->getQty() . " " .$barang->getUnit();?></td>
										<td class="center"><?php echo formatrp($barang->getBarangStock()->getPrice());?></td>
										<td class="center"><?php echo $barang->getBarangStock()->getStockDate()->format('d-m-Y');?></td>
										<td><a class="edit" href="<?php echo base_url().'katalog/createEdit/'.$barang->getId()?>">Edit</a></td>
										<td><a class="delete" href="javascript:;">Delete</a></td>
									</tr>		
								<?php	} ?>
								</tbody>
							</table>
							<div class="row-fluid">
								<?php $this->load->view('paging', $pBarang);?>
							</div>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
			<!-- END PAGE CONTENT -->
		</div>
		<!-- END PAGE CONTAINER-->
	</div>
	<!-- END PAGE -->
</div>
<!-- END CONTAINER -->
<?php $this->load->view('footer')?>

